package com.wl.cloud.common.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author: wanglin
 * @date: 2023-08-02 周三
 * @Version: 1.0
 * @Description:
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {IsNotBlankListValidator.class})
public @interface NotBlankInList {

    boolean required() default false;

    String message() default "field not can blank";

    /**
     * 指定约束分组，在某一个分组时才执行此约束验证
     *
     * @return
     */
    Class<?>[] groups() default {};

    /**
     * payload 指定的payload，会在验证结果中携带此字段，比如：可以用于验证结果的严重等级分类
     *
     * @return
     */
    Class<? extends Payload>[] payload() default {};
}
